﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ContractVerify.ascx.cs" Inherits="TravelSite.Controls.ContractVerify" %>

<script type="text/javascript">
    $(function () {
        $("#verifyDialog").dialog({ modal: true, autoOpen: false, width: 1100, resizable: false });
        $("#verifyDialog").parent().appendTo(jQuery("form:first"));
        $(".ui-dialog-titlebar").hide();
    });

    function createVerifyForm(id) {
        __doPostBack('upVerify', id);
    }

    function openVerify() {
        $('#verifyDialog').dialog('open');
    }
</script>

<div id="verifyDialog">
    <asp:UpdatePanel runat="server" ID="upVerify" OnLoad="upVerify_Load" UpdateMode="Conditional" ClientIDMode="Static">
            <ContentTemplate>
            <div class="row">
                    <div class="fieldset_block col-lg-12 page_area">
                        <fieldset>
                            <legend><h4>Verify package</h4></legend>
                            <asp:Label runat="server" ID="hdContractId" style="display:none;" />
                            <asp:Label runat="server" ID="hdTravelId" style="display:none;" />
                            <div class="fieldset_cotent form-horizontal">
                                <div class="row">
                                    <div class="col-lg-12">
                                        Package: <asp:Label runat="server" ID="lblPackage" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-12">
                                        Destination: <asp:Label runat="server" ID="lblPackageDestination" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-12">
                                        Travel dates: <asp:Label runat="server" ID="lblTravelDate" />
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-12">
                                    <asp:Repeater runat="server" ID="grid" OnItemDataBound="grid_ItemDataBound" OnItemCommand="grid_ItemCommand">
                                        <ItemTemplate>
                                            <div class="col-lg-12" style="padding-top:5px;">                                    
                                                <div class="form-group">
                                                        <asp:HiddenField ID="hidId" Value='<%#Eval("SelectedChoiceId")%>' runat="server" />
                                                        <asp:Label runat="server" ID="lblOptionName" Text='<%# Eval("OptionName") + ": "%>' CssClass="control-label" />
                                                        <asp:Label runat="server" ID="lblOptionChoice" />
                                                        <asp:TextBox runat="server" ID="tbOverrideChoice" Visible="false" />
                                                        <asp:ImageButton runat="server" ID="lbOverride" ImageUrl="~/images/design/actions_icon/edit_icon.png" ToolTip="Override choice"
                                                            CommandName="override" CommandArgument='<%# Eval("OptionId")%>' />
                                                </div>
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    </div>
                                </div>

                                <div class="button_group">
                                    <asp:Button CssClass="btn btn-success" ID="btnBooked" Text="Booked" runat="server" OnClick="btnBooked_Click" OnClientClick="return confirm('Please confirm that this package is now verified')" />
                                    <asp:Button CssClass="btn btn-success" ID="btnClear" Text="Clear" runat="server" OnClick="btnClear_Click" OnClientClick="return confirm('Please confirm that need clear this package')" />
                                    <asp:Button CssClass="btn btn-success" ID="btnCanceled" Text="Cancel" runat="server" OnClick="btnCanceled_Click" OnClientClick="return confirm('Are you sure to cancel this package?')" />
                                    <asp:Button CssClass="btn btn-info" ID="btnCancel" Text="Close" runat="server" OnClientClick="$('#verifyDialog').dialog('close'); return false;" />
                                </div>
                            </div>
                        </fieldset>
                    </div>
            </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnBooked" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnClear" EventName="Click" />
                <asp:PostBackTrigger ControlID="btnCanceled" />
            </Triggers>
    </asp:UpdatePanel>
</div> 
